#!/bin/bash

# create directory
mkdir /data/cps
mkdir /data/cps/data
mkdir /data/data/cps/data/devbus
mkdir /data/cps/log
mkdir /data/cps/log/devbus
mkdir /data/cps/log/devbus/devedge
tar -zxvf /opt/images/devbus/devbus-data-devedge.tar.gz -C /data/cps/data/devbus

# import images
if [ $1 -eq 1 ]; then
  docker load < /opt/images/devbus/devbus-devedge-3.0.tar
  docker load < /opt/images/devbus/devbus-devred-3.1.0.tar
  docker load < /opt/images/devbus/devbus-influxdb-2.7.1.tar
  docker load < /opt/images/devbus/devbus-mysql-8.0.34.tar
  docker load < /opt/images/devbus/devbus-rabbitmq-3.12.6.tar
elif [ $1 -eq 2 ]; then
  echo "Not currently supported!"
fi
